<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Авторизация</title>
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
    <link rel="stylesheet" type="text/css" href="/css/template.css"/>
    <link rel="stylesheet" type="text/css" href="/css/gallery.css"/>
    <link rel="stylesheet" type="text/css" href="/css/dark.css"/>
    <link rel="stylesheet" type="text/css" href="/css/buttons.css"/>
    <link href='http://fonts.googleapis.com/css?family=Lobster&subset=latin,cyrillic' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="auth">
    <div class="title">
        <h1>Войти</h1>
        <a href="/user/registration.html">Регистрация</a>
    </div>
    <p>
        <c:if test="${not empty param.error}">
            <font color="red"> <spring:message code="label.loginerror"/>
            </font>
        </c:if>

    </p>
    <sec:authorize ifAnyGranted="ROLE_ANONYMOUS">
        <form method="post" action="<c:url value='/j_spring_security_check' />" id="AuthFormId">
            <div class="form_item">
                <label for="j_username"><spring:message code="label.login"/>:&nbsp;</label>

                <div class="form_field">
                    <input type="text" value="" name="j_username" id="j_username"/>
                </div>
            </div>

            <div class="form_item"><label for="j_password"><spring:message code="label.password"/>:&nbsp;</label>

                <div class="form_field">
                    <input type="password" value="" name="j_password" id="j_password"/>
                </div>
            </div>
            <div class="form_item">
                <input type="checkbox"
                       name="_spring_security_remember_me"/>&nbsp;<label><spring:message
                    code="label.remember"/></label>

            </div>
            <div class="form_item">
                <button type="submit" class="button red"><span>Войти</span></button>
            </div>
        </form>
        <div class="form_item"><a href="/restorepas.html" title="Забыли пароль?">Забыли пароль?</a></div>
    </sec:authorize>
</div>
</div>
</body>
</html>